package com.edocbase.desktop.search;

import java.io.IOException;

import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.search.Query;

public interface ISearchEngine {
	public static final String ID_FIELD = "ID";
	public static final String PATH_FIELD = "PATH";
	public static final String TITLE_FIELD = "TITLE";
	public static final String CONTENT_FIELD = "CONTENT";
	public static final String DELETED_FIELD = "DELETED";
	public static final String DELETED = "1";
	public static final String NO_DELETED = "0";

	public abstract void close();

//	public abstract void addDocument(String id, String path, String title,
//			String content) throws CorruptIndexException, IOException;

	public abstract void addIndexable(DocumentIndexable indexable) throws Exception;
	
	public abstract void commit() throws CorruptIndexException, IOException;

	public abstract void remove(String id);

	public abstract void restore(String diaryId, Long newId);

	public abstract void delete(String id);

	public abstract IPageList search(String field,String word,Page page);

	public abstract IPageList search(Query query,Page page);
	
	public abstract DiaryDocument getById(String id);


}